package cn.xd.core.ddd.diff;

import cn.xd.core.enums.DiffTypeEnum;
import lombok.Data;

/**
 * @author mirzaLin
 * @data 2023/11/17
 * @description DB比较差异
 **/
@Data
public class Diff {
    private DiffTypeEnum diffType = DiffTypeEnum.Added;

    private String fieldName;

    private Object oldValue;

    private Object newValue;

    public Diff() {
    }

    public Diff(String fieldName, DiffTypeEnum diffType, Object newValue) {
        this.fieldName = fieldName;
        this.diffType = diffType;
        this.newValue = newValue;
    }

    public Diff(String fieldName, DiffTypeEnum diffType, Object oldValue, Object newValue) {
        this.fieldName = fieldName;
        this.diffType = diffType;
        this.oldValue = oldValue;
        this.newValue = newValue;
    }
}
